package backend.event;

import java.util.LinkedList;
import java.util.List;

import backend.event.handler.IEventHandler;

public abstract class AbstractEvent implements IEvent {
	
	private List<IEventHandler> handlers = new LinkedList<IEventHandler>();

	public void setEventHandlers(List<IEventHandler> handlers) {
		this.handlers = handlers;
	}

	public void addEventHandler(IEventHandler handler) {
		this.handlers.add(handler);
	}

	public void handleEvent(IEvent e) {
		for(IEventHandler handler : handlers){
			handler.handleEvent(e);
		}
	}
	

}
